﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using Sispe.Entities;

namespace Sispe.Repository.Mapping
{
    public class HOJA_RECORRIDO_OPERACIONESMap : EntityTypeConfiguration<HOJA_RECORRIDO_OPERACIONES>
    {
        public HOJA_RECORRIDO_OPERACIONESMap()
        {
            // Primary Key
            this.HasKey(t => t.IdHojaRecorrido);

            // Properties
            this.Property(t => t.IdHojaRecorrido)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.JP_004)
                .HasMaxLength(300);

            this.Property(t => t.RE_004)
                .HasMaxLength(300);

            this.Property(t => t.SC_005)
                .HasMaxLength(300);

            this.Property(t => t.SPP_004)
                .HasMaxLength(300);

            this.Property(t => t.JOF_IC_005)
                .HasMaxLength(300);

            this.Property(t => t.IP_007)
                .HasMaxLength(300);

            this.Property(t => t.SCC_004)
                .HasMaxLength(300);

            this.Property(t => t.OC_001)
                .HasMaxLength(100);

            this.Property(t => t.OC_Documentos);

            // Table & Column Mappings
            this.ToTable("HOJA_RECORRIDO_OPERACIONES");
            this.Property(t => t.IdHojaRecorrido).HasColumnName("IdHojaRecorrido");
            this.Property(t => t.JP_001).HasColumnName("JP_001");
            this.Property(t => t.JP_002).HasColumnName("JP_002");
            this.Property(t => t.JP_003).HasColumnName("JP_003");
            this.Property(t => t.JP_004).HasColumnName("JP_004");
            this.Property(t => t.RE_001).HasColumnName("RE_001");
            this.Property(t => t.RE_002).HasColumnName("RE_002");
            this.Property(t => t.RE_003).HasColumnName("RE_003");
            this.Property(t => t.RE_004).HasColumnName("RE_004");
            this.Property(t => t.SC_001).HasColumnName("SC_001");
            this.Property(t => t.SC_002).HasColumnName("SC_002");
            this.Property(t => t.SC_003).HasColumnName("SC_003");
            this.Property(t => t.SC_004).HasColumnName("SC_004");
            this.Property(t => t.SC_005).HasColumnName("SC_005");
            this.Property(t => t.SPP_001).HasColumnName("SPP_001");
            this.Property(t => t.SPP_002).HasColumnName("SPP_002");
            this.Property(t => t.SPP_003).HasColumnName("SPP_003");
            this.Property(t => t.SPP_004).HasColumnName("SPP_004");
            this.Property(t => t.JOF_IC_001).HasColumnName("JOF_IC_001");
            this.Property(t => t.JOF_IC_002).HasColumnName("JOF_IC_002");
            this.Property(t => t.JOF_IC_003).HasColumnName("JOF_IC_003");
            this.Property(t => t.JOF_IC_004).HasColumnName("JOF_IC_004");
            this.Property(t => t.JOF_IC_005).HasColumnName("JOF_IC_005");
            this.Property(t => t.IP_001).HasColumnName("IP_001");
            this.Property(t => t.IP_002).HasColumnName("IP_002");
            this.Property(t => t.IP_003).HasColumnName("IP_003");
            this.Property(t => t.IP_004).HasColumnName("IP_004");
            this.Property(t => t.IP_005).HasColumnName("IP_005");
            this.Property(t => t.IP_006).HasColumnName("IP_006");
            this.Property(t => t.IP_007).HasColumnName("IP_007");
            this.Property(t => t.SCC_001).HasColumnName("SCC_001");
            this.Property(t => t.SCC_002).HasColumnName("SCC_002");
            this.Property(t => t.SCC_003).HasColumnName("SCC_003");
            this.Property(t => t.SCC_004).HasColumnName("SCC_004");
            this.Property(t => t.OC_001).HasColumnName("OC_001");
            this.Property(t => t.OC_Documentos).HasColumnName("OC_Documentos");
            this.Property(t => t.JOF).HasColumnName("JOF");
            this.Property(t => t.JOF_Fecha).HasColumnName("JOF_Fecha");

            // Relationships
            this.HasRequired(t => t.HOJA_FIN_RECORRIDO_LIQUIDACIONES)
                .WithOptional(t => t.HOJA_RECORRIDO_OPERACIONES);

        }
    }
}
